#!/bin/bash
#set -n
set -x
lstart_secs=$SECONDS
if [[ "$1" = "-h" ]] ; then
	projdir="$2"
	shift 2
else
	projdir=
fi
	
is_cygwin=$1
is_vista=$2
export file_nbr=$3
#set -x
if [[ -f /usr/bin/grep ]] ; then
	grep_path=/usr/bin/grep
else
	grep_path=/bin/grep
fi
if [[ -f /usr/bin/sed ]] ; then
	sed_path=/usr/bin/sed
else
	sed_path=/bin/sed
fi
function common_lines
{
set -x
fn="$1"
wtk_project=$2
svn_project=$3
svn_project_ext=$4
set +x
ic=0

#Using ant.bat is faster on windows (I think other ant may access login files).
if (( is_cygwin == 1 )) ; then
  ant_pgm=ant.bat
  atest_tmp='C:\cygwin\tmp'
else
  ant_pgm=ant
  atest_tmp='/tmp'
fi
#needed? adir_base=$(basename $srcdir)
#needed? echo "export ${adir_base}_file=$fn
#needed? export ${adir_base}_tag=$tag" >> $ii/srcenv.sh
rm -f $ii/$fn
#set -x
while (( ic < ${#vfiles[*]} )) ; do
  sfile="so${vfiles[$ic]%%.sh}.vim"
  if [[ -n "${cfiles[$ic]}" ]] ; then
	  echo ":so \$I/${sfile} | map ${cfiles[$ic]} :so \$I/${sfile} | " >> $ii/$fn
  else
	  echo ":so \$I/${sfile} | " >> $ii/$fn
  fi
  (( ic = ic + 1 ))
done
echo ":e \$II/whyadd" >> $ii/$fn
echo ":e \$II/whyaddl" >> $ii/$fn
echo ":e \$II/whydel" >> $ii/$fn
echo ":e \$II/whydell" >> $ii/$fn
echo ":e \$II/whycmt" >> $ii/$fn
echo ":e \$II/whycmtl" >> $ii/$fn
printf ":unmenu F&2_seeker \r\n" >> $ii/$fn
printf ":unmenu F&4_tab.Substitute | unmenu F&5_cmn.Edit \r\n" >> $ii/$fn
printf ":unmenu F&2_j2me \r\n" >> $ii/$fn
smapcmd=""
emapcmd=""
ic=0
echomapcmd=""
while (( ic < ${#vfiles[*]} )) ; do
  cfile="${vfiles[$ic]}"
  sfile="so${cfile%%.sh}.vim"
  if [[ -n "$smapcmd" ]] ; then
    smapcmd="$smapcmd | "
    emapcmd="$emapcmd | "
  fi
  mapkey="${kfiles[$ic]}"
  if [[ -n "$mapkey" ]] ; then
	smapcmd="${smapcmd}map $mapkey :so \$I/$sfile \|"
	emapcmd="${emapcmd}map $mapkey :e \$II/$cfile \|"
  else
	menukey="${mfiles[$ic]}"
    if [[ -n "$menukey" ]] ; then
	  smapcmd="${smapcmd}menu F&g_j2me.$menukey :so \$I/$sfile<cr>"
	  emapcmd="${emapcmd}menu F&g_j2me.$menukey :e \$II/$cfile<cr>"
	fi
  fi
  mapkeyonly="${cfiles[$ic]}"
  if [[ -n "$mapkeyonly" ]] ; then
	smapcmd="${smapcmd} | map $mapkeyonly :so \$I/$sfile"
	emapcmd="${emapcmd} | map $mapkeyonly :e \$II/$cfile"
	echomapcmd="$echomapcmd\\\n$mapkeyonly \$II/$cfile"
  fi
  (( ic = ic + 1 ))
done
#set -x
if (( (file_nbr == 0) || (file_nbr == 2) || (file_nbr == 10) )) ; then
	smartphone=".smartphone"
else
	smartphone=
fi
set +x
if [[ "$(hostname)" = "gateway-$USER-desktop" ]] ; then
	export wtk_home=/opt/WTK2.5.1
else
	export wtk_home=/opt/WTK2.5.1
fi
export wtk_proj_home=$wtk_home/apps
export full_wtk_project="$wtk_proj_home/$wtk_project"
if [[ -z "$projdir" ]] ; then
	export full_svn_project="$wtk_proj_home/$wtk_project/$svn_project"
	set -x
	if [[ -n "$svn_project_ext" ]] ; then
		shift 3
		export full_svn_project_ext=
		while (( $# > 0 )) ; do
			svn_project_ext="$1"
			export full_svn_project_ext="$full_svn_project_ext $wtk_proj_home/$wtk_project/$svn_project_ext"
			if (( $# > 0 )) ; then
				shift 1
			else
				break
			fi
		done
	fi
	set +x
else
	export full_svn_project="$projdir"
	export full_svn_project_ext="$projdir_ext"
fi
export full_svn_test_project="$wtk_proj_home/$wtk_project/$svn_project"
#Undo?
export full_svn_test_project="/tmp/$USER/svn/$svn_project"
export cd_wtk_project=":!cd $full_wtk_project"
export cd_svn_project=":!cd $full_svn_project"
export cd_svn_test_project=":!cd $full_svn_test_project"
export svn_wtk_build_file="$full_svn_project/wtkbuild/wtk-build.xml"
export svn_wtk_web_tomcat_build_file="$full_svn_project/wtkbuild/wtk-web-tomcat-build.xml"
export svn_wtk_web_weblogic_build_file="$full_svn_project/wtkbuild/wtk-web-weblogic-build.xml"
export build_prop="-Dbuild.template=.template\ \
-Dwtk.template=.template\ \
-Drelease.template=.template\ \
-Dtest.template=.template\ \
-Doptional.template=.template"
export build_dtest_prop="-Dbuild.template=.template\ \
-Dwtk.template=.template\ \
-Dtest.template=-test.template\ \
-Drelease.template=.template\ \
-Doptional.template=.template\ \
-DDJMTESTDEF=DNOJMTEST\ -DDTESTDEF=DTEST\ \
-DDTESTUIDEF=DTESTUI\ -DDLOGDEF=DNOLOGGING"
export build_test_prop="-Dbuild.template=-test.template\ \
-Dwtk.template=.template\ \
-Dtest.template=-test.template\ \
-Drelease.template=.template\ \
-Doptional.template=.template\ \
-DDTESTDEF=DTEST\ \
-DDJMTESTDEF=DNOJMTEST\ -DDTESTDEF=DTEST\ \
-DDTESTUIDEF=DTESTUI\ -DDLOGDEF=DNOLOGGING"
export build_ctest_prop="-Dbuild.template=-compatibility.template\ \
-Dwtk.template=.template\ \
-Dtest.template=-test.template\ \
-Drelease.template=.template\ \
-Doptional.template=.template\ \
-DDTESTDEF=DTEST\ \
-DDTESTUIDEF=DTESTUI\ -DDLOGDEF=DNOLOGGING"
export exec_template_parms="-Dbuild.template=.template \
-Dtest.template=.template \
-Dwtk.template=.template \
-Drelease.template=.template \
-Doptional.template=.template"
export exec_dlogging_parms="-DDLOGDEF=DLOGGING \
-Djar.lib=../../../JLogMicro/jlogmicro/target/dist/midp20_jlogmicro.jar \
-Djar.presrc=../../../JLogMicro/jlogmicro/presrc \
-DFEATURERELEASE= \
-DDFEATUREFORMDEF=DFEATUREFORM"
export exec_parms="$exec_template_parms -f $svn_wtk_build_file"
export exec_web_tomcat_parms="$exec_template_parms -f $svn_wtk_web_tomcat_build_file"
export exec_web_weblogic_parms="$exec_template_parms -f $svn_wtk_web_weblogic_build_file"
export build_dtest_parms="$full_svn_project\ -f\ $svn_wtk_build_file\ $build_dtest_prop"
export build_ctest_parms="$full_svn_project\ -f\ $svn_wtk_build_file\ $build_ctest_prop"
export build_parms="$full_svn_project\ -f\ $svn_wtk_build_file\ $build_prop"
#export build_1_target_parms="$full_svn_project\ -f\ $svn_wtk_build_file\ $build_prop\ -Done.target=true"
export build_1_target_parms="$build_parms\ -Done.target=true"
export build_compat_parms="$build_1_target_parms\ -Dcopy.compat=true\ -DDCOMPATDEF=DCOMPATIBILITY\ -Dcompat.presrc=../compatpresrc"
export build_web_tomcat_parms="$full_svn_project\ -f\ $svn_wtk_web_tomcat_build_file\ $build_prop"
export build_web_weblogic_parms="$full_svn_project\ -f\ $svn_wtk_web_weblogic_build_file\ $build_prop"
export build_test_parms="$full_svn_project\ -f\ $svn_wtk_build_file\ $build_test_prop"
export exec_prev_parms="-Dbuild.template=-test.template \
-Dtest.template=.template \
-DDTESTDEF=DNOTEST \
-DDTESTUIDEF=DNOTESTUI \
-Dwtk.template=.template \
-Drelease.template=.template \
-Doptional.template=.template \
-f $svn_wtk_build_file"
echo "" >> $ii/$fn

sofn="so${fn%%.sh}.vim"
echo "if exists(\"\$myfn\")
let \$myofn=\$myfn
else
let \$myofn=\"\"
endif
let \$myfn=\"$fn\"
let \$mycdsvnp=\"$full_svn_project\"
let \$myfullsvn=\"$full_svn_project\"
let \$myexecparms=\"$exec_parms\"
let \$mybuildparms=\"$build_parms\"
let \$mybuild1tgtparms=\"$build_1_target_parms\"
let \$mybuildcompatparms=\"$build_compat_parms\"" > $i/$sofn
if [[ -n "$full_svn_project_ext" ]] ; then
	echo "let \$myfullsvnext=\"$full_svn_project_ext\"" >> $i/$sofn
else
	echo "let \$myfullsvnext=\"\"" >> $i/$sofn
fi
echo "edit $fn" >> $i/$sofn
smapcmd="$smapcmd | map <F1> l"
emapcmd="$emapcmd | map <F1> l"
premapcmd=":so \$I/$sofn | let \$mycmds=\"$echomapcmd\" | call DefProjCmds() | map <C-k>x :call EchoCmds() | "
smapcmd="$premapcmd $smapcmd | map <F1> l"
emapcmd="$premapcmd $emapcmd | map <F1> l"
printf "$smapcmd \r\n" >> $ii/$fn
printf "$emapcmd \r\n" >> $ii/$fn
echo "\"Not so useful map commands" >> $ii/$fn
printf ":map <F4> :e \$II/${fn}\r\n" >> $ii/$fn
printf ":map <F6> :e \$II/${fn}\r\n" >> $ii/$fn
printf ":map <F7> :e \$II/${fn}\r\n" >> $ii/$fn
printf ":map <S-F11> :e \$II/${fn}\r\n" >> $ii/$fn
printf ":map <S-F12> :e \$II/${fn}\r\n" >> $ii/$fn
printf ":map <S-F10> :e \$II/${fn}\r\n" >> $ii/$fn

#echo ":'b,'e s/[^ ][^ ]* /:!\$I\/diffcvs.sh /" >> $ii/$fn
#echo ":'b,'e s/[^ ][^ ]* /:!\$I\/commitcvs.sh /" >> $ii/$fn
#echo ":'b,'e s/[^ ][^ ]* /:!\$I\/updatecvs.sh /" >> $ii/$fn
#echo ":'b,'e s/[^ ][^ ]* /:!\$I\/addcvs.sh /" >> $ii/$fn
#echo ":'b,'e s/[^ ][^ ]* /:!\$I\/removecvs.sh /" >> $ii/$fn
echo ":!\$I/diffproj2.sh $full_svn_project -wEB 2>&1 | tee \$II/${fn}_diff.log" >> $ii/$fn
echo ":!\$I/diffproj2.sh $full_svn_project -wEbB 2>&1 | tee \$II/${fn}_diff.log" >> $ii/$fn
echo ":!\$I/diffproj2.sh $full_svn_project -wEibB 2>&1 | tee \$II/${fn}_diff.log" >> $ii/$fn
echo ":!\$I/diffproj2.sh $full_svn_project -w 2>&1 | tee \$II/${fn}_diff.log" >> $ii/$fn
echo ":e \$II/why.diff" >> $ii/$fn
echo ":e \$II/${fn}_diff.log" >> $ii/$fn
echo ":!\$I/tuidiff.sh" >> $ii/$fn
echo ":e \$II/whylog" >> $ii/$fn
echo ":e \$II/$fn.logsvn" >> $ii/$fn
echo ":e \$II/$fn.logcvs" >> $ii/$fn
echo ":e \$II/$fn.revsvn" >> $ii/$fn
echo ":e \$II/$fn.revcvs" >> $ii/$fn
#echo "$cd_svn_project;svn commit -m \"z\" src/com/substanceofcode/rssreader/presentation/RssReader.java" >> $ii/$fn
#echo "$cd_svn_project;svn add src/com/substanceofcode/rssreader/presentation/RssReader.java" >> $ii/$fn
export mkt="compile.1.0"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt" >> $ii/$fn
export mkti="compile.1.0.intlink"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkti" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.1.0.large" >> $ii/$fn
export mkt0="compile.2.0"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt0" >> $ii/$fn
export mkt0i="compile.2.0.intlink"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt0i" >> $ii/$fn
export mkt0j75="compile.2.0.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt0j75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.jsr120" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.jsr135" >> $ii/$fn
export mkt1="compile.2.0.cldc.1.1"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt1" >> $ii/$fn
if [[ -n "$smartphone" ]] ; then
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
export mkt1m="compile.2.0.cldc.1.1${smartphone}"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt1m" >> $ii/$fn
export mkt1mj75="compile.2.0.cldc.1.1${smartphone}.jsr75"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt1mj75" >> $ii/$fn
export mkt1mj75sign="compile.2.0.cldc.1.1${smartphone}.signed.jsr75"
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ $mkt1mj75sign" >> $ii/$fn

echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.cldc.1.1${smartphone}.jsr135" >> $ii/$fn
fi
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.cldc.1.1.jsr75.jsr82.jsr120.jsr135.jsr184" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.cldc.1.1.jsr75.jsr82.jsr120.jsr135.jsr184.jsr205" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.securesms.2.0.cldc.1.1.jsr75.jsr82.jsr120.jsr135.jsr184" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.large.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.large.jsr135" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.cldc.1.1.large.jsr75.jsr82.jsr184" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.cldc.1.1.large.jsr75.jsr82.jsr135.jsr184" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.no.graphics" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ -DDLOGDEF=DNOLOGGING\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ compile.2.0.jsr238" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_parms\ compile.j2se" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_parms\ compile.all" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_parms\ -Dskey=4321\ -Dinput=src/test/sm/hello.txt\ -Doutput=${atest_tmp}/out.txt\ test.j2se" >> $ii/$fn
echo "\"Test previous release" >> $ii/$fn
echo '"Set testdef testui.' >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.1.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.2.0" >> $ii/$fn
echo '"More previous set testdef testui.' >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.2.0.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo '"More previous set testdef testui.' >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.2.0.cldc.1.1${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.2.0.cldc.1.1${smartphone}.signed.jsr75" >> $ii/$fn
echo "\"Test UI current version testui" >> $ii/$fn
echo "\"First just MIDP-2.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_dtest_parms\ compile.2.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_dtest_parms\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_dtest_parms\ compile.2.0.cldc.1.1${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_dtest_parms\ compile.2.0.cldc.1.1${smartphone}.signed.jsr75" >> $ii/$fn
echo "\"Test compatibility current version" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_compat_parms\ compile.1.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_compat_parms\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_compat_parms\ $mkt1mj75sign" >> $ii/$fn
echo "\"Test compatibility no logging current version" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_parms\ -Dcopy.compat=true\ -DDCOMPATDEF=DCOMPATIBILITY\ -Dcompat.presrc=../compatpresrc\ -DDLOGDEF=DNOLOGGING\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo '"Set compatibility testdef testui.' >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_ctest_parms\ compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ compile.1.0" >> $ii/$fn
echo '"Set regular compiles.' >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.1.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.1.0.intlink" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.intlink" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ -DDTESTDEF=DTEST\ dist.compile.2.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.cldc.1.1${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.cldc.1.1${smartphone}.signed.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.cldc.1.1${smartphone}.signed.jsr75.jsr82.jsr120.jsr135.jsr184" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.cldc.1.1${smartphone}.signed.jsr75.jsr82.jsr120.jsr135.jsr184.jsr205" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.jsr238" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.cldc.1.1.large.jsr75.jsr82.jsr184" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_1_target_parms\ dist.compile.2.0.cldc.1.1.large.jsr75.jsr82.jsr135.jsr184" >> $ii/$fn
echo "\"Dist previous release" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ dist.compile.1.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ dist.compile.2.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ -DDTESTDEF=DTEST\ dist.compile.2.0" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ dist.compile.2.0.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ dist.compile.2.0${smartphone}.jsr75" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_test_parms\ dist.compile.2.0.jsr238" >> $ii/$fn
echo "\"Tomcat" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_web_tomcat_parms\ compile.web.plain.java" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_web_tomcat_parms\ generate.web.jsp.java\ -Dcompile.web.plain.java.done=true" >> $ii/$fn
echo "\"Do not skip steps" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_web_tomcat_parms\ precompile.web.jsp.java" >> $ii/$fn
echo "\"Weblogic" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_web_weblogic_parms\ compile.web.plain.java" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_web_weblogic_parms\ generate.web.jsp.java\ -Dcompile.web.plain.java.done=true" >> $ii/$fn
echo "\"Do not skip steps" >> $ii/$fn
echo ":set makeprg=\$i/antc.sh\ $build_web_weblogic_parms\ precompile.web.jsp.java" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms clean" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms test.j2se" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms build.testdata" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms build.padfiles" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.preprocess.2.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.preprocess.2.0.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms preprocess.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms test.preprocess.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -DDLOGDEF=DNOLOGGING test.preprocess.2.0${smartphone}.jsr75" >> $ii/$fn
export rel0="dist.midp.1.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel0" >> $ii/$fn
export rel0i="dist.midp.1.0.intlink" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel0i" >> $ii/$fn
echo "\"Don't obfuscate." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dno.obfuscate=true dist.midp.1.0" >> $ii/$fn
echo "\"Disp 1.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dneed.test.res=true -Dres.test.dir=C:/cygwin/tmp/testdata -Dres.test.todir= dist.midp.1.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.intlink" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.cldc.1.1" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.cldc.1.1.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.cldc.1.1${smartphone}.jsr75" >> $ii/$fn
export rel1mvsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.verisign"
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1mvsign" >> $ii/$fn
"$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.cldc.1.1${smartphone}.signed.thawte" >> $ii/$fn
export rel1mtsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.thawte" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1mtsign" >> $ii/$fn
export rel1m75tsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.thawte.jsr75"
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1m75tsign" >> $ii/$fn
export rel1m7582120135184vsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.verisign.jsr75.jsr82.jsr120.jsr135.jsr184" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1m7582120135184vsign" >> $ii/$fn
export rel1m7582120135184tsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.thawte.jsr75.jsr82.jsr120.jsr135.jsr184"
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1m7582120135184tsign" >> $ii/$fn
export rel1m7582120135184205vsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.verisign.jsr75.jsr82.jsr120.jsr135.jsr184.jsr205" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1m7582120135184205vsign" >> $ii/$fn
export rel1m7582120135184205tsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.thawte.jsr75.jsr82.jsr120.jsr135.jsr184.jsr205"
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1m7582120135184205tsign" >> $ii/$fn
export rel1m75vsign="dist.midp.2.0.cldc.1.1${smartphone}.signed.verisign.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1m75vsign" >> $ii/$fn
export rel1m75godaddy="dist.midp.2.0.cldc.1.1${smartphone}.signed.godaddy.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $rel1m75godaddy" >> $ii/$fn
#Set stage info
export stage_info_base="-Dstage=beta2 -Dustage=BETA2 -Dstage.stable.text=stable -Dstage.phase.text=production -Dno.individual.file=false -Dstage.featured=Featured, -Dno.jar.sign=false"
export stage_info_rim="$stage_info_base -Dno.rim.sign=false"
export stage_info_norim="$stage_info_base -Dno.rim.sign=true"
export stage_info_norim_nojar="$stage_info_base -Dno.rim.sign=true -Dno.jar.sign=true"
echo "\"With rim sign." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $stage_info_rim dist.midp.2.0.cldc.1.1${smartphone}.signed.verisign.jsr75" >> $ii/$fn
echo "\"With rim sign." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $stage_info_rim dist.midp.2.0.cldc.1.1${smartphone}.signed.thawte.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.jsr75.jsr82.jsr184.largemem" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.jsr75.jsr82.jsr135.jsr184.largemem" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.cldc.1.1.jsr75.jsr82.jsr120.jsr135.jsr184" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms log.midp.2.0.cldc.1.1${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -DDTESTDEF=DTEST dist.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo '"Dist novice version.' >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.novice" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms run.test.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms run.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms run.dist.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms run.dist.midp.2.0.cldc.1.1${smartphone}.jsr75" >> $ii/$fn
echo '"Use beta2, featured, and dist.test.' >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dstage=beta2 -Dustage=BETA2 -Dstage.stable.text=stable -Dstage.featured=Featured, run.dist.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.jsr238" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.test.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.test.midp.2.0.cldc.1.1${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.rss" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.games" >> $ii/$fn
echo "\"Skip svn w/o rim w/o jar signed." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms  -Dno.rim.sign=true -Dno.jar.sign=true -Dskip.svn.op=true dist" >> $ii/$fn
echo "\"Skip svn without rim signed." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms  -Dno.rim.sign=true -Dskip.svn.op=true dist" >> $ii/$fn
echo "\"Skip svn with rim signed." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms  -Dno.rim.sign=false -Dskip.svn.op=true dist" >> $ii/$fn
echo "\"Skip svn." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dskip.svn.op=true dist.rss" >> $ii/$fn
echo "\"Skip svn." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dskip.svn.op=true dist.games" >> $ii/$fn
echo "\"With rim sign." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $stage_info_rim dist" >> $ii/$fn
echo "\"Without rim sign." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $stage_info_norim dist" >> $ii/$fn
echo "\"With rim sign." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $stage_info_rim dist.test" >> $ii/$fn
echo "\"With rim sign." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $stage_info_rim dist.rss" >> $ii/$fn
echo "\"With rim sign." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $stage_info_rim dist.games" >> $ii/$fn
echo "\"With rim sign and skip." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dskip.svn.op=true $stage_info_rim dist" >> $ii/$fn
echo "\"Without rim sign and skip." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dskip.svn.op=true $stage_info_norim dist" >> $ii/$fn
echo "\"With rim sign and skip." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dskip.svn.op=true $stage_info_rim dist.rss" >> $ii/$fn
echo "\"With rim sign and skip." >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms -Dskip.svn.op=true $stage_info_rim dist.games" >> $ii/$fn
echo '"Set testdef testui.' >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_prev_parms dist.midp.1.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_prev_parms dist.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.1.0.reversi" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms dist.midp.2.0.reversi" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms package.midp.1.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms package.midp.2.0" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms package.midp.2.0.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms package.midp.2.0${smartphone}.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms package.midp.2.0.jsr238" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_web_tomcat_parms build.war" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_web_tomcat_parms tomcat.deploy" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_web_tomcat_parms start.tomcat" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_web_tomcat_parms stop.tomcat" >> $ii/$fn
echo "\"Logging program" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $exec_dlogging_parms -Dlog.subdir=bogus -Dstage=logging -Dustage=LOGGING dist.midp.2.0.jsr75" >> $ii/$fn
echo "$cd_svn_project;\$I/antl.sh $exec_parms $exec_dlogging_parms -Dlog.subdir=bogus -Dstage=logging -Dustage=LOGGING dist.midp.2.0.cldc.1.1" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.java'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.h'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.m'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.c'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.cpp'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.cxx'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.jsp'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.tld'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.xml'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.html'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.htm'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.txt'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.sh'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.pm'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.pl'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.py'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.properties'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.template'\\ -n" >> $ii/$fn
echo ":set grepprg=\$I/grepf.sh\\ $full_svn_project\\ '*.*'\\ -n" >> $ii/$fn
if (( is_cygwin != 0 )) ; then
	echo ":!\$I/massjupdate.sh $full_svn_project 2>&1 | tee \$II/massjupd.log" >> $ii/$fn
else
	echo ":!\$I/massjupdate.sh $full_svn_project /usr/bin 2>&1 | tee \$II/massjupd.log" >> $ii/$fn
fi
echo ":!\$I/mkj2mefiles.sh -f $fn 2>&1 | tee $fn.log" >> $ii/$fn
echo ":!\$I/mkj2mefiles.sh 2>&1 | tee mkj2mefiles.log" >> $ii/$fn
echo ":Xm" >> $ii/$fn
echo ":Xma" >> $ii/$fn
echo ":e $fn.log" >> $ii/$fn
echo ":e mkj2mefiles.log" >> $ii/$fn
echo ":e ~/src/vim-bash-hacks/src/bash/mkj2mefiles.sh" >> $ii/$fn
echo ":e ~/src/vim-bash-hacks/src/bash/mkj2melines.sh" >> $ii/$fn
echo ":e ~/src/vim-bash-hacks/src/bash/massjupdate.sh" >> $ii/$fn
echo ":!\$I/cpyfiles.sh" >> $ii/$fn
#echo ":e \$full_svn_project/lib" >> $ii/$fn
echo ":e $full_svn_project/target" >> $ii/$fn
echo ":e $full_svn_project/src" >> $ii/$fn
echo ":e $full_svn_project/bin/$wtk_project.jad" >> $ii/$fn
echo ":e $full_svn_project/testdata" >> $ii/$fn
echo ":e $full_svn_project/webtestdata" >> $ii/$fn
echo ":e $full_svn_project/target/$svn_project/src" >> $ii/$fn
tmpa=$II/why.all
#  -e '\.#' > $tmpa
if [[ -e /bin/find ]] ; then
	findcmd=/bin/find
else
	findcmd=/usr/bin/find
fi
set -x
$findcmd $full_svn_project $full_svn_project_ext -type f \( ! -name '*.jar' -a ! -name '*.wmf' \
  -a ! -name '*Root' -a ! -name '*.dfPackage' -a ! -path '*/Repository' \
	-a ! -path '*/Entries' -a ! -path '*/Tag' -a ! -name '*.dfUseCase' \
	-a ! -path '*/CVS/*' -a ! -path '*/.svn/*' -a ! -path '*/build/*' \
	-a ! -name '*.dfActivity' -a ! -name '*.dfSequence' -a ! -path '*/target/*' \
	-a ! -name '*.class' \) > $tmpa
$grep_path -v -e '/src_cldc10' -e '/src_cldc11' -e '/zipedsrc' -e '/bin[0-9][0-9]*' -e '/src/.*Compatibility' -e '.swp' -e '/target/' -e '/eclipse-classes/' $tmpa | \
$i/preplist.pl | \
$sed_path -e "s/^.*compatsrc/#Compat\n:e &/" -e 's/^/:e /' >> $ii/$fn
echo ":!svn checkout https://mobile-rss-reader.googlecode.com/svn/trunk/ mobile-rss-reader --username ibuntonjr" >> $ii/$fn
echo '"m for ' >> $ii/$fn
echo '/$jj/^Ind' >> $ii/$fn
echo '?^indW"ny$jj/copyright.*#16' >> $ii/$fn
echo ':1,$s/; *System.out.println("here.*$/;/ | 1,$s/} *System.out.println("here.*$/}/' >> $ii/$fn
echo ':1,$s/; * if .m_loadForm != null. {m_loadForm.appendMsg("here.*$/;/' >> $ii/$fn
echo ':1,$s/; *m_midlet.recordMsg("here.*$/;/' >> $ii/$fn
echo ':1,$s#^\([^=]*\)=\(.*\)$#    <entry key="\1">\2</entry>#' >> $ii/$fn
echo ':grep -i undo' >> $ii/$fn
echo ':grep yste.*here' >> $ii/$fn
echo '"End' >> $ii/$fn
$sed_path -e 's/^/:e /' < $tmpa > $II/$fn.all
echo ":!rm whylog" > $ii/$fn.logcvs
$grep_path -v -e '/target/' $tmpa | grep -v -e '/bin' | $sed_path -e 's#^#:!$I/logcvs.sh #' >> $ii/$fn.logcvs
echo ":!rm whylog" > $ii/$fn.logsvn
$grep_path -v -e '/target/' $tmpa | grep -v -e '/bin' | $sed_path -e 's#^#:!$I/logsvn.sh #' >> $ii/$fn.logsvn
echo ":!rm whyrev" > $ii/$fn.revcvs
$grep_path -v -e '/target/' $tmpa | grep -v -e '/bin' | $sed_path -e 's#^#:!$I/revcvs.sh #' >> $ii/$fn.revcvs
echo ":!rm whyrev" > $ii/$fn.revsvn
$grep_path -v -e '/target/' $tmpa | grep -v -e '/bin' | $sed_path -e 's#^#:!$I/revsvn.sh #' >> $ii/$fn.revsvn
echo "source $I/soj2mefunctions.vim" >> $i/$sofn
echo "function! DefProjDepCmd()
	command! M call MakeCmd(\"$mkt\",\"n\",\"\",\"\")
	command! MY call MakeCmd(\"$mkt\",\"y\",\"\",\"\")
	command! My call MakeCmd(\"$mkt\",\"y\",\"\",\"\")
	command! MD call MakeCmd(\"dist.$mkt\",\"y\",\"\",\"\")
	command! Md call MakeCmd(\"dist.$mkt\",\"y\",\"\",\"\")
	command! Mi call MakeCmd(\"$mkti\",\"n\",\"\",\"\")
	command! MIY call MakeCmd(\"$mkti\",\"y\",\"\",\"\")
	command! Miy call MakeCmd(\"$mkti\",\"y\",\"\",\"\")
	command! MDI call MakeCmd(\"dist.$mkti\",\"y\",\"\",\"\")
	command! Mdi call MakeCmd(\"dist.$mkti\",\"y\",\"\",\"\")
	command! M0 call MakeCmd(\"$mkt0\",\"n\",\"\",\"\")
	command! M0Y call MakeCmd(\"$mkt0\",\"y\",\"\",\"\")
	command! M0y call MakeCmd(\"$mkt0\",\"y\",\"\",\"\")
	command! MD0 call MakeCmd(\"dist.$mkt0\",\"y\",\"\",\"\")
	command! Md0 call MakeCmd(\"dist.$mkt0\",\"y\",\"\",\"\")
	command! M0i call MakeCmd(\"$mkt0i\",\"n\",\"\",\"\")
	command! M0iY call MakeCmd(\"$mkt0i\",\"y\",\"\",\"\")
	command! M0iy call MakeCmd(\"$mkt0i\",\"y\",\"\",\"\")
	command! MD0i call MakeCmd(\"dist.$mkt0i\",\"y\",\"\",\"\")
	command! Md0i call MakeCmd(\"dist.$mkt0i\",\"y\",\"\",\"\")
	command! M075 call MakeCmd(\"$mkt0j75\",\"n\",\"\",\"\")
	command! Md075 call MakeCmd(\"dist.$mkt0j75\",\"n\",\"\",\"\")
	command! M075 call MakeCmd(\"$mkt0j75\",\"n\",\"\",\"\")
	command! Md075 call MakeCmd(\"dist.$mkt0j75\",\"n\",\"\",\"\")
	command! M075y call MakeCmd(\"$mkt0j75\",\"y\",\"\",\"\")
	command! Md075y call MakeCmd(\"dist.$mkt0j75\",\"y\",\"\",\"\")
	command! M075y call MakeCmd(\"$mkt0j75\",\"y\",\"\",\"\")
	command! Md075y call MakeCmd(\"dist.$mkt0j75\",\"y\",\"\",\"\")
	command! M1 call MakeCmd(\"$mkt1\",\"n\",\"\",\"\")
	command! Md1 call MakeCmd(\"dist.$mkt1\",\"n\",\"\",\"\")
	command! M1m call MakeCmd(\"$mkt1m\",\"n\",\"\",\"\")
	command! Md1m call MakeCmd(\"dist.$mkt1m\",\"n\",\"\",\"\")
	command! M1m call MakeCmd(\"$mkt1m\",\"n\",\"\",\"\")
	command! Md1m call MakeCmd(\"dist.$mkt1m\",\"n\",\"\",\"\")
	command! M1mY call MakeCmd(\"$mkt1m\",\"y\",\"\",\"\")
	command! Md1mY call MakeCmd(\"dist.$mkt1m\",\"y\",\"\",\"\")
	command! M1my call MakeCmd(\"$mkt1m\",\"y\",\"\",\"\")
	command! Md1my call MakeCmd(\"dist.$mkt1m\",\"y\",\"\",\"\")
	command! M1m75 call MakeCmd(\"$mkt1mj75\",\"n\",\"\",\"\")
	command! Md1m75 call MakeCmd(\"dist.$mkt1mj75\",\"n\",\"\",\"\")
	command! M1m75 call MakeCmd(\"$mkt1mj75\",\"n\",\"\",\"\")
	command! Md1m75 call MakeCmd(\"dist.$mkt1mj75\",\"n\",\"\",\"\")
	command! M1m75Y call MakeCmd(\"$mkt1mj75\",\"y\",\"\",\"\")
	command! Md1m75Y call MakeCmd(\"dist.$mkt1mj75\",\"y\",\"\",\"\")
	command! M1m75y call MakeCmd(\"$mkt1mj75\",\"y\",\"\",\"\")
	command! Md1m75y call MakeCmd(\"dist.$mkt1mj75\",\"y\",\"\",\"\")
	command! M1m75S call MakeCmd(\"$mkt1mj75sign\",\"n\",\"\",\"\")
	command! M1m75s call MakeCmd(\"$mkt1mj75sign\",\"n\",\"\",\"\")
	command! Mc1m75S call MakeCmd(\"$mkt1mj75sign\",\"n\",\"y\",\"\")
	command! Mc1m75s call MakeCmd(\"$mkt1mj75sign\",\"n\",\"y\",\"\")
	command! Md1m75S call MakeCmd(\"dist.$mkt1mj75sign\",\"n\",\"\",\"\")
	command! Md1m75s call MakeCmd(\"dist.$mkt1mj75sign\",\"n\",\"\",\"\")
	command! M1m75SY call MakeCmd(\"$mkt1mj75sign\",\"y\",\"\",\"\")
	command! M1m75sy call MakeCmd(\"$mkt1mj75sign\",\"y\",\"\",\"\")
	command! Md1m75SY call MakeCmd(\"dist.$mkt1mj75sign\",\"y\",\"\",\"\")
	command! Md1m75sy call MakeCmd(\"dist.$mkt1mj75sign\",\"y\",\"\",\"\")
	command! R0 call ReleaseCmd(\"$rel0\",\"y\",\"\")
	command! R0I call ReleaseCmd(\"$rel0i\",\"y\",\"\")
	command! R0i call ReleaseCmd(\"$rel0i\",\"y\",\"\")
	command! R0IN call ReleaseCmd(\"$rel0i\",\"n\",\"\")
	command! R0in call ReleaseCmd(\"$rel0i\",\"n\",\"\")
	command! R1MSV call ReleaseCmd(\"$rel1mvsign\",\"y\",\"\")
	command! R1msv call ReleaseCmd(\"$rel1mvsign\",\"y\",\"\")
	command! R1MSVN call ReleaseCmd(\"$rel1mvsign\",\"n\",\"\")
	command! R1msvn call ReleaseCmd(\"$rel1mvsign\",\"n\",\"\")
	command! R1MST call ReleaseCmd(\"$rel1mtsign\",\"y\",\"\")
	command! R1mst call ReleaseCmd(\"$rel1mtsign\",\"y\",\"\")
	command! R1MSTN call ReleaseCmd(\"$rel1mtsign\",\"n\",\"\")
	command! R1mstn call ReleaseCmd(\"$rel1mtsign\",\"n\",\"\")
	command! R1M75SV call ReleaseCmd(\"$rel1m75vsign\",\"y\",\"\")
	command! R1m75sv call ReleaseCmd(\"$rel1m75vsign\",\"y\",\"\")
	command! R1M75SVN call ReleaseCmd(\"$rel1m75vsign\",\"n\",\"\")
	command! R1m75svn call ReleaseCmd(\"$rel1m75vsign\",\"n\",\"\")
	command! R1M75SG call ReleaseCmd(\"$rel1m75godaddy\",\"y\",\"\")
	command! R1m75sg call ReleaseCmd(\"$rel1m75godaddy\",\"y\",\"\")
	command! R1M75SGN call ReleaseCmd(\"$rel1m75godaddy\",\"n\",\"\")
	command! R1m75sgn call ReleaseCmd(\"$rel1m75godaddy\",\"n\",\"\")
	command! R1M75ST call ReleaseCmd(\"$rel1m75tsign\",\"y\",\"\")
	command! R1m75st call ReleaseCmd(\"$rel1m75tsign\",\"y\",\"\")
	command! R1M75STN call ReleaseCmd(\"$rel1m75tsign\",\"n\",\"\")
	command! R1m75stn call ReleaseCmd(\"$rel1m75tsign\",\"n\",\"\")
	command! R1M7582120135184SV call ReleaseCmd(\"$rel1m7582120135184vsign\",\"y\",\"\")
	command! R1m7582120135184sv call ReleaseCmd(\"$rel1m7582120135184vsign\",\"y\",\"\")
	command! R1m7582120135184SVN call ReleaseCmd(\"$rel1m7582120135184vsign\",\"n\",\"\")
	command! R1m7582120135184svn call ReleaseCmd(\"$rel1m7582120135184vsign\",\"n\",\"\")
	command! R1m7582120135184ST CALL ReleaseCmd(\"$rel1m7582120135184tsign\",\"y\",\"\")
	command! R1m7582120135184st call ReleaseCmd(\"$rel1m7582120135184tsign\",\"y\",\"\")
	command! R1m7582120135184STN CALL ReleaseCmd(\"$rel1m7582120135184tsign\",\"n\",\"\")
	command! R1m7582120135184stn call ReleaseCmd(\"$rel1m7582120135184tsign\",\"n\",\"\")
	command! R1mALL call ReleaseCmd(\"$rel1m7582120135184vsign\",\"y\",\"\")
	command! R1mall call ReleaseCmd(\"$rel1m7582120135184vsign\",\"y\",\"\")
	command! R1mALLN call ReleaseCmd(\"$rel1m7582120135184vsign\",\"n\",\"\")
	command! R1malln call ReleaseCmd(\"$rel1m7582120135184vsign\",\"n\",\"\")
	command! R1mALL call ReleaseCmd(\"$rel1m7582120135184vsign\",\"y\",\"\")
	command! R1mall call ReleaseCmd(\"$rel1m7582120135184vsign\",\"y\",\"\")
	command! R1mALLN call ReleaseCmd(\"$rel1m7582120135184vsign\",\"n\",\"\")
	command! R1malln call ReleaseCmd(\"$rel1m7582120135184vsign\",\"n\",\"\")
endfunction
call DefProjDepCmd()" >> $i/$sofn
/bin/mv $tmpa $II/$fn.tmp
}
cfn="$4"
if [[ (-z "$one_fn") || ("$one_fn" == "$cfn") ]] ; then
	lfn="$4"
	cp "$ii/$lfn" "$ii/$lfn.bak"
	first_dir="$5"
	shift 5
	common_lines "$lfn" "$first_dir" $* 
	lend_secs=$SECONDS
	echo "$4 \
ELAPSED=$(( (lend_secs - lstart_secs)/60 )): \
$(( (lend_secs - lstart_secs)%60 ))"
fi
